﻿using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Drawing;
using System.Linq;
using System.Text;

namespace FinalYear.iNavigate.Classes
{
    public class CollisionWithSpeed
    {
        public int WalkingSpeed { get; set; }

        public EuclideanDistances Distances { get; set; }

        public CollisionWithSpeed(EuclideanDistances distances)
        {
            // TODO : get the speed from the phone 
            this.WalkingSpeed = 3;
            this.Distances = distances;
        }

        public void TimeToContact()
        {
            if (this.Distances != null)
            {
                for (int i = 0; i < this.Distances.Count; i++)
                {
                    double yDifference = -(this.Distances[i].translatedPoint.Y / this.Distances[i].originalPoint.Y);
                    double currentDepthAccordingToSpeed = this.WalkingSpeed * yDifference;
                    Debug.WriteLine("The current depth of the Point : {0} => {1}", i, currentDepthAccordingToSpeed);
                }
            }
        }
    }
}
